package com.csgc.camera.http

import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass


@JsonClass(generateAdapter = true)
data class BaseResponse<out T : Any>(
    @Json(name = "code") val code: Int,
    @Json(name = "msg") val msg: String,
    @Json(name = "data") val data: T?
) {
    fun isSuccess(): Boolean {
        return this.code == ERROR_CODE_SUCCESS
    }
}

const val ERROR_CODE_SUCCESS = 200